/**
 * @fileOverview  Defines namespaces, global variables and exceptions/errors  
 * 
 * @author Gerd Wagner
 */
oa = {
  learner: {},
  supportedLanguages: ["en","de"],
  basicAdditionStatistics: [],
  basicMultiplicationStatistics: [],
  learningUnits: [],
  showAllContents: false,
  problemCounter: 0, // counts the problems per learning unit
  correctAnswerCounter: 0,  // counts the correct answers per learning unit
  attemptCounter: 0,
  currentLearningUnit: null,
  currentExercise: null,
  currentExerciseNumber: 0,
  previousProblem: null,
  currentProblem: null,
  currentProblems: [],
  currentProblemNumber: 0  // counts the problems per exercise

};
/**
 * Define namespaces  
 */
// Namespace for controller functions
oa.ctrl = {};
// Namespace for arithmetic problem type objects
oa.apt = {};
//Namespace for rendering form objects
oa.rf = {};
//Namespace for learning units
oa.lu = {};

/**
 *  Error Types 
 */
MandatoryValueConstraintViolation = function ( msg, culprit) {
  this.name = "MandatoryValueConstraintViolation";
  this.message = msg;
  this.culprit = culprit;
};
MandatoryValueConstraintViolation.prototype = new Error();
MandatoryValueConstraintViolation.prototype.constructor = MandatoryValueConstraintViolation;

TypeConstraintViolation = function ( msg, culprit) {
  this.name = "TypeConstraintViolation";
  this.message = msg;
  this.culprit = culprit;
};
TypeConstraintViolation.prototype = new Error();
TypeConstraintViolation.prototype.constructor = TypeConstraintViolation;

ValueRangeConstraintViolation = function ( msg, culprit) {
  this.name = "ValueRangeConstraintViolation";
  this.message = msg;
  this.culprit = culprit;
};
ValueRangeConstraintViolation.prototype = new Error();
ValueRangeConstraintViolation.prototype.constructor = ValueRangeConstraintViolation;

OtherConstraintViolation = function ( msg, culprit) {
  this.name = "OtherConstraintViolation";
  this.message = msg;
  this.culprit = culprit;
};
OtherConstraintViolation.prototype = new Error();
OtherConstraintViolation.prototype.constructor = OtherConstraintViolation;
